// 组合函数要满足结合律
const _ = require("loadsh");

// const reverse = (arr) => arr.reverse();
// const first = (arr) => arr[0];
// const toUpper = (s) => s.toUpperCase();

const f = _.flowRight(_.toUpper, _.first, _.reverse);
const f1 = _.flowRight(_.flowRight(_.toUpper, _.first), _.reverse);
const f2 = _.flowRight(_.toUpper, _.flowRight(_.first, _.reverse));
console.log(
  f(["one", "two", "three", "four", "five", "six"]),
  f1(["one", "two", "three", "four", "five", "six"]),
  f2(["one", "two", "three", "four", "five", "six"])
);
